import { adminUrl, teacherUrl } from "@/utils/baseUrl.js";
import request from "@/utils/request";

// 获取申报人下拉
// export function teacherList(str) {
//   return request({
//     url: teacherUrl + '/collegebase/teacher-teachers/byFindStr/list?findStr='+str,
//     method: 'get'
//   })
// }
export function teacherList() {
  return request({
    url: teacherUrl + "/study/teacher/attendance/teacherAllList",
    method: "get",
  });
}
export function getTeacherBossUser(params) {
  return request({
    url: teacherUrl + "/study/teacher/attendance/getTeacherBossUser",
    method: "get",
    params
  });
}
// 获取事由列表
export function getLeaveType(data) {
  return request({
    url: teacherUrl + "/study/teacher/attendance/getLeaveReason",
    method: "get",
    data: data,
  });
}

// 创建请假申请
export function createLeave(data) {
  return request({
    url: teacherUrl + "/study/teacher/attendance/apply/leave",
    method: "post",
    data: data,
  });
}

// 获得请假申请
export function getLeave(id) {
  return request({
    url: adminUrl + "/bpm/oa/leave/get?id=" + id,
    method: "get",
  });
}

// 获得请假申请分页
export function getLeavePage(query) {
  return request({
    url: teacherUrl + "/study/teacher/attendance/page",
    method: "get",
    params: query,
  });
}
// 删除请假
export function deleteLeave(id) {
  return request({
    url: teacherUrl + "/study/teacher/attendance/delete?id=" + id,
    method: "delete",
  });
}
